package com.hui.server.utils;

import com.hui.server.pojo.Admin;
import org.springframework.security.core.context.SecurityContextHolder;

/**
 * author iterhui
 * email 767092533@qq.com
 **/
public class AdminUtils {

    /**
     * 获取当前登录操作员
     * @return
     */
    public static Admin getCurrentAdmin(){
        return (Admin) SecurityContextHolder
                .getContext()
                .getAuthentication()
                .getPrincipal();
    }
}
